@import '../../style/themes/index.less';

@keyboard-prefix-cls: ~'@{prefix}-keyboard';

.@{keyboard-prefix-cls} {
  background-color: #ededed;

  &-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4000;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    user-select: none;
    -webkit-user-select: none;
    background-color: #ededed;
  }

  &-inner {
    height: 480px;
    position: relative;
    background-color: #fff;
  }

  &-key {
    position: absolute;
    font-size: 48px;
    font-family: sans-serif;
    color: #000;
    display: block;
    width: 25%;
    border: 2px solid #dedfe2;
    margin: -2px;
    background-color: #fafafb;
    font-family: 'PingFang SC', 'Microsoft yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    // text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
    height: 120px;
    line-height: 120px;
    box-sizing: content-box;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    transition: 0.3s;
    overflow: hidden;
    text-align: center;

    // &:after {
    //   content: '';
    //   position: absolute;
    //   left: -15%;
    //   top: -15%;
    //   border-radius: 100%;
    //   z-index: 1;
    //   animation-fill-mode: both;
    //   width: 130%;
    //   height: 130%;
    //   background: #dadada;
    //   opacity: 0;
    // }

    &.down {
      background: #eaeaea;
    }

    &.confirm-btn {
      height: 360px;
    }
  }

  .left-0 {
    left: 0;
  }
  .left-1 {
    left: 25%;
  }
  .left-2 {
    left: 50%;
  }
  .left-3 {
    left: 75%;
  }
  .top-0 {
    top: 0;
  }
  .top-1 {
    top: 120px;
  }
  .top-2 {
    top: 240px;
  }
  .top-3 {
    top: 360px;
  }

  [data-code='backspace'] img {
    width: 66px;
    border: 0;
    box-sizing: border-box;
  }

  &-key:active .submit-btn {
    background-color: darken(@btn-primary-bg, 10%);
  }

  .submit-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    color: #fff;
    background-color: @primary-color;
    letter-spacing: 2px;
    transition: 0.3s;
    line-height: 1.5;

    &.disabled {
      cursor: not-allowed;
      color: rgba(0, 0, 0, 0.25);
      background-color: #f5f5f5;
      border-color: #d9d9d9;
    }

    &.loading {
      display: block;
      width: 100%;
      height: 100%;
    }
  }
}
